package com.abcdefg.rabbitmqopsdemo.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("producer")
@RestController
public class OpsProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("ops")
    public String ops(){
        rabbitTemplate.convertAndSend("","ops.queue","ops test...");
        return "消息发送成功";
    }
}
